const first = () =>
  new Promise((resolve, reject) => {
    console.log(3);

    let p = new Promise((resolve, reject) => {
      console.log(7);
      setTimeout(() => {
        console.log(5);
        resolve(6); // 已经被改变了 不会触发了
        console.log(p);
      });
      resolve(1);
    });

    resolve(2);

    p.then(arg => {
      console.log(arg,'lo1');
    });
  });

first().then(arg => {
  console.log(arg,'lo2');
});

console.log(4);

//  3 7 4 1 2 5 Promise(fulfilled:1)




// const first1 = () =>
//   new Promise((resolve, reject) => {

//     let p = new Promise((resolve, reject) => {
//       console.log(p,'log'); //错误被 下面的 then捕获了
//     });
//     p.then(()=>{},(res)=>{console.log(res,'log')});
//   });

// first1()
